stop(); 
nc=new NetConnection(); 
nc.connect(null); 
newStream=new NetStream(nc); 
video1.attachVideo(newStream); 
newStream.setBufferTime(15); 
newStream.play("{shockwaveflashvideo_flv_filename}"); 

this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 200, 22);

this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());
progressBar_mc.createEmptyMovieClip("bar_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.bar_mc) {
    beginFill(0xFFFFFF);
    moveTo(0, 0);
    lineTo(100, 0);
    lineTo(100, 10);
    lineTo(0, 10);
    lineTo(0, 0);
    endFill();
    _xscale = 0;
}
progressBar_mc.createEmptyMovieClip("stroke_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.stroke_mc) {
    lineStyle(0, 0xffffff);
    moveTo(0, 0);
    lineTo(100, 0);
    lineTo(100, 10);
    lineTo(0, 10);
    lineTo(0, 0);
}

loaded_interval = setInterval(checkBytesLoaded, 500, newStream);
function checkBytesLoaded(my_ns) {
    var pctLoaded = Math.round(my_ns.bytesLoaded/my_ns.bytesTotal*100);

    loaded_txt.text = Math.round(my_ns.bytesLoaded/1024)+" of "+Math.round(my_ns.bytesTotal/1024)+" KiB loaded ("+pctLoaded+"%)";

    my_fmt = new TextFormat();
    my_fmt.color = 0xffffff;
    my_fmt.underline = true;
    loaded_txt.setTextFormat(my_fmt);

    progressBar_mc.bar_mc._xscale = pctLoaded;
    if (pctLoaded>=100) {
    clearInterval(loaded_interval);
    }
}